package net.cz.wc.command;

public enum CommandTypeEnum {
	
	JROCKIT ("jrockit", "net.cz.wc.command.JRockitCommand"), 
	HOTSPOT ("hotspot", "net.cz.wc.command.HotSpotCommand"), 
	ACCESS ("access", "net.cz.wc.command.AccessCommand"),
	ACCESSHTTPD ("access-httpd", "net.cz.wc.command.AccessHTTPDCommand"),
	JMETER ("jmeter", "net.cz.wc.command.JMeterCommand"),
	EXTRACT ("ext", "net.cz.wc.command.ExtractCommand"),
	INT ("int", "net.cz.wc.command.IntervalCommand"),
	LIST ("lst", "net.cz.wc.command.ListCommand"),
	STATS ("sta", "net.cz.wc.command.StatsCommand");
	
	private String text;
	
	private String commandImpl;
	
	public String getCommandImp() {
		return commandImpl;
	}
	
	public String getText() {
		return text;
	}
	
	CommandTypeEnum (String commandText, String commandImpl) {
		this.text = commandText;
		this.commandImpl = commandImpl;
	}
	
	public static CommandTypeEnum getCommand(String command) {
		for (CommandTypeEnum commandT : CommandTypeEnum.values()) {
			if (commandT.getText().equals(command)) {
				return commandT;
			}
		}
		return null;
	}
}
